import 'package:myapp/entities/entities.dart';
import 'models.dart';

class MyUser {
  String userId;
  String email;
  String name;
  Profile profile;

  MyUser({
    required this.userId,
    required this.email,
    required this.name,
    required this.profile
  });

  
  static final empty = MyUser(
		userId: '', 
		email: '', 
		name: '',
    profile: Profile.empty
	);

  MyUserEntity toEntity() {
    return MyUserEntity(
      userId: userId, 
      email: email, 
      name: name,
      profile: profile
    );
  }

  static MyUser fromEntity(MyUserEntity entity) {
    return MyUser(
      userId: entity.userId, 
      email: entity.email, 
      name: entity.name, 
      profile: entity.profile
    );
  }

  @override
  String toString() {
    return 'MyUser: $userId, $email, $name';
  }
}